﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Clothes.Model;

namespace Clothes.IDAL
{
    public interface BaseIDAL<T> where T:BaseContext
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="t">数组可以添加多个</param>
        /// <returns></returns>
        bool Insert(params T[] t);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="t">删除表</param>
        /// <returns></returns>
        bool Delect(int id);

        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="expression">可以在BLL中添加where条件</param>
        /// <returns></returns>
        List<T> Select(Expression<Func<T,bool>> expression);

        /// <summary>
        /// 根据条件查询
        /// </summary>
        /// <param name="expression"></param>
        /// <returns></returns>
        T Tiao(Expression<Func<T, bool>> expression);
    }
}
